Option Strict Off
Option Explicit On
Friend Class frmProperties
	Inherits System.Windows.Forms.Form
#Region "Windows Form Designer generated code "
	Public Sub New()
		MyBase.New()
		If m_vb6FormDefInstance Is Nothing Then
			If m_InitializingDefInstance Then
				m_vb6FormDefInstance = Me
			Else
				Try 
					'For the start-up form, the first instance created is the default instance.
					If System.Reflection.Assembly.GetExecutingAssembly.EntryPoint.DeclaringType Is Me.GetType Then
						m_vb6FormDefInstance = Me
					End If
				Catch
				End Try
			End If
		End If
		'This call is required by the Windows Form Designer.
		InitializeComponent()
	End Sub
	'Form overrides dispose to clean up the component list.
	Protected Overloads Overrides Sub Dispose(ByVal Disposing As Boolean)
		If Disposing Then
			If Not components Is Nothing Then
				components.Dispose()
			End If
		End If
		MyBase.Dispose(Disposing)
	End Sub
	'Required by the Windows Form Designer
	Private components As System.ComponentModel.IContainer
	Public ToolTip1 As System.Windows.Forms.ToolTip
	Public WithEvents ScheduleProperties1 As AxScheduler.AxScheduleProperties
	Public WithEvents _cmdButton_1 As System.Windows.Forms.Button
	Public WithEvents _cmdButton_0 As System.Windows.Forms.Button
	Public WithEvents TabStrip1 As AxMSComctlLib.AxTabStrip
	Public WithEvents cmdButton As Microsoft.VisualBasic.Compatibility.VB6.ButtonArray
	'NOTE: The following procedure is required by the Windows Form Designer
	'It can be modified using the Windows Form Designer.
	'Do not modify it using the code editor.
	<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container()
        Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(frmProperties))
        Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components)
        Me.ScheduleProperties1 = New AxScheduler.AxScheduleProperties()
        Me._cmdButton_1 = New System.Windows.Forms.Button()
        Me._cmdButton_0 = New System.Windows.Forms.Button()
        Me.TabStrip1 = New AxMSComctlLib.AxTabStrip()
        Me.cmdButton = New Microsoft.VisualBasic.Compatibility.VB6.ButtonArray(Me.components)
        CType(Me.ScheduleProperties1, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.TabStrip1, System.ComponentModel.ISupportInitialize).BeginInit()
        CType(Me.cmdButton, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'ScheduleProperties1
        '
        Me.ScheduleProperties1.Enabled = True
        Me.ScheduleProperties1.Location = New System.Drawing.Point(16, 40)
        Me.ScheduleProperties1.Name = "ScheduleProperties1"
        Me.ScheduleProperties1.OcxState = CType(resources.GetObject("ScheduleProperties1.OcxState"), System.Windows.Forms.AxHost.State)
        Me.ScheduleProperties1.Size = New System.Drawing.Size(433, 284)
        Me.ScheduleProperties1.TabIndex = 0
        '
        '_cmdButton_1
        '
        Me._cmdButton_1.BackColor = System.Drawing.SystemColors.Control
        Me._cmdButton_1.Cursor = System.Windows.Forms.Cursors.Default
        Me._cmdButton_1.DialogResult = System.Windows.Forms.DialogResult.Cancel
        Me._cmdButton_1.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me._cmdButton_1.ForeColor = System.Drawing.SystemColors.ControlText
        Me.cmdButton.SetIndex(Me._cmdButton_1, CType(1, Short))
        Me._cmdButton_1.Location = New System.Drawing.Point(384, 336)
        Me._cmdButton_1.Name = "_cmdButton_1"
        Me._cmdButton_1.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me._cmdButton_1.Size = New System.Drawing.Size(73, 25)
        Me._cmdButton_1.TabIndex = 2
        Me._cmdButton_1.Text = "Cancel"
        '
        '_cmdButton_0
        '
        Me._cmdButton_0.BackColor = System.Drawing.SystemColors.Control
        Me._cmdButton_0.Cursor = System.Windows.Forms.Cursors.Default
        Me._cmdButton_0.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me._cmdButton_0.ForeColor = System.Drawing.SystemColors.ControlText
        Me.cmdButton.SetIndex(Me._cmdButton_0, CType(0, Short))
        Me._cmdButton_0.Location = New System.Drawing.Point(304, 336)
        Me._cmdButton_0.Name = "_cmdButton_0"
        Me._cmdButton_0.RightToLeft = System.Windows.Forms.RightToLeft.No
        Me._cmdButton_0.Size = New System.Drawing.Size(73, 25)
        Me._cmdButton_0.TabIndex = 1
        Me._cmdButton_0.Text = "Ok"
        '
        'TabStrip1
        '
        Me.TabStrip1.Location = New System.Drawing.Point(8, 8)
        Me.TabStrip1.Name = "TabStrip1"
        Me.TabStrip1.OcxState = CType(resources.GetObject("TabStrip1.OcxState"), System.Windows.Forms.AxHost.State)
        Me.TabStrip1.Size = New System.Drawing.Size(449, 320)
        Me.TabStrip1.TabIndex = 3
        '
        'cmdButton
        '
        '
        'frmProperties
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.CancelButton = Me._cmdButton_1
        Me.ClientSize = New System.Drawing.Size(463, 367)
        Me.ControlBox = False
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.ScheduleProperties1, Me._cmdButton_1, Me._cmdButton_0, Me.TabStrip1})
        Me.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
        Me.Location = New System.Drawing.Point(3, 24)
        Me.MaximizeBox = False
        Me.MinimizeBox = False
        Me.Name = "frmProperties"
        Me.ShowInTaskbar = False
        Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
        Me.Text = "Properties"
        CType(Me.ScheduleProperties1, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.TabStrip1, System.ComponentModel.ISupportInitialize).EndInit()
        CType(Me.cmdButton, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)

    End Sub
#End Region 
#Region "Upgrade Support "
	Private Shared m_vb6FormDefInstance As frmProperties
	Private Shared m_InitializingDefInstance As Boolean
	Public Shared Property DefInstance() As frmProperties
		Get
			If m_vb6FormDefInstance Is Nothing OrElse m_vb6FormDefInstance.IsDisposed Then
				m_InitializingDefInstance = True
				m_vb6FormDefInstance = New frmProperties()
				m_InitializingDefInstance = False
			End If
			DefInstance = m_vb6FormDefInstance
		End Get
		Set
			m_vb6FormDefInstance = Value
		End Set
	End Property
#End Region 
	
	'UPGRADE_NOTE: ParentForm was upgraded to ParentForm_Renamed. Click for more: 'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="vbup1061"'
	Public ParentForm_Renamed As frmChild
	Dim ConflictWarn As Boolean
	Public Sub RefreshForm(ByVal lViewMode As Scheduler.ViewModeConstants, ByVal lTimeFormat As Scheduler.ScheduleTimeFormats, ByVal bAllowEventHeader As Boolean, ByVal bReadOnly As Boolean, ByVal bConflictWarn As Boolean, ByVal oSelectedItem As Scheduler.CScheduleEl, ByVal oCategories As Scheduler.CCategoryCol, ByVal oRooms As Scheduler.CRoomCol, ByVal oProviders As Scheduler.CProviderCol)
		
		On Error GoTo ErrHandler
		Const cPROCNAME As String = "RefreshForm"
		
		ConflictWarn = bConflictWarn
		
		'Setup the buttons
		If bReadOnly Then
			cmdButton(0).Visible = False
			cmdButton(1).Text = "Close"
		Else
			cmdButton(0).Visible = True
			cmdButton(1).Text = "Cancel"
		End If
		
		ScheduleProperties1.Visible = False
		ScheduleProperties1.AllowEventHeader = bAllowEventHeader
		ScheduleProperties1.ViewMode = lViewMode
		ScheduleProperties1.TimeFormat = lTimeFormat
		ScheduleProperties1.ReadOnly = bReadOnly
		ScheduleProperties1.set_Categories(oCategories)
		ScheduleProperties1.Rooms = oRooms
		ScheduleProperties1.Providers = oProviders
		ScheduleProperties1.SelectedItem = oSelectedItem
		Call ScheduleProperties1.CtlRefresh()
		ScheduleProperties1.Visible = True
		
		TabStrip1.Height = VB6.TwipsToPixelsY(VB6.PixelsToTwipsY(ScheduleProperties1.Height) + VB6.PixelsToTwipsY(TabStrip1.Top) + (VB6.PixelsToTwipsY(TabStrip1.Height) - TabStrip1.ClientHeight))
		cmdButton(0).Top = VB6.TwipsToPixelsY(VB6.PixelsToTwipsY(TabStrip1.Top) + VB6.PixelsToTwipsY(TabStrip1.Height) + 120)
		cmdButton(1).Top = cmdButton(0).Top
		Me.Height = VB6.TwipsToPixelsY(VB6.PixelsToTwipsY(cmdButton(0).Top) + VB6.PixelsToTwipsY(cmdButton(0).Height) + 120 + (VB6.PixelsToTwipsY(Me.Height) - VB6.PixelsToTwipsY(Me.ClientRectangle.Height)))
		
EndSub: 
		Exit Sub
		
ErrHandler: 
		Call SetErr(Err.Number, Err.Description, Me.Name, cPROCNAME)
		GoTo EndSub
		
	End Sub
	Private Sub cmdButton_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdButton.Click
		Dim Index As Short = cmdButton.GetIndex(eventSender)
		
		On Error GoTo ErrHandler
		Const cPROCNAME As String = "cmdButton_Click"
		
		Dim ParOut(1) As Object
		Select Case Index
			
			Case 0 'Ok
				Call ScheduleProperties1.Save()
				'UPGRADE_WARNING: Couldn't resolve default property of object ParOut(0). Click for more: 'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="vbup1037"'
				ParOut(0) = True
				
			Case 1 'Cancel
				'UPGRADE_WARNING: Couldn't resolve default property of object ParOut(0). Click for more: 'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="vbup1037"'
				ParOut(0) = False
				
		End Select
		Me.Close()
		
EndSub: 
		Exit Sub
		
ErrHandler: 
		Call SetErr(Err.Number, Err.Description, Me.Name, cPROCNAME)
		GoTo EndSub
		
	End Sub
	Private Sub frmProperties_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
		
		ScheduleProperties1.WarningMessage = "This is a custom warning message that I have put on the screen for you to see!" & vbCrLf & "Notice that it will display two lines if need be."
		
	End Sub
    'UPGRADE_WARNING: Form event frmProperties.Unload has a new behavior. Click for more: 'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="vbup2065"'
    Private Sub frmProperties_Closed(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Closed

        On Error GoTo ErrHandler
        Const cPROCNAME As String = "Form_Unload"

        'UPGRADE_NOTE: Object ParentForm_Renamed may not be destroyed until it is garbage collected. Click for more: 'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="vbup1029"'
        ParentForm_Renamed = Nothing
        'UPGRADE_NOTE: Object frmProperties may not be destroyed until it is garbage collected. Click for more: 'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="vbup1029"'
        frmProperties.DefInstance = Nothing

EndSub:
        Exit Sub

ErrHandler:
        Call SetErr(Err.Number, Err.Description, Me.Name, cPROCNAME)
        GoTo EndSub

    End Sub
    Private Sub ScheduleProperties1_ValidateAppointment(ByVal eventSender As System.Object, ByVal eventArgs As AxScheduler.__ScheduleProperties_ValidateAppointmentEvent) Handles ScheduleProperties1.ValidateAppointment

        On Error GoTo ErrHandler
        Const cPROCNAME As String = "ScheduleProperties1_ValidateAppointment"

        If ConflictWarn Then

            'Check to make sure that this appointment will not
            'cover any area defined as a NODROP zone
            If Not ParentForm_Renamed.Schedule1.IsEnabledAreaByValues(eventArgs.startDate, eventArgs.room, eventArgs.startTime, eventArgs.apptLength, False) Then
                Call MsgBox("The specified data will create an appointment that will cover an illegal area.", MsgBoxStyle.Exclamation, "Invalid!")
            End If

        End If

EndSub:
        Exit Sub

ErrHandler:
        Call SetErr(Err.Number, Err.Description, Me.Name, cPROCNAME)
        GoTo EndSub

    End Sub
    Private Sub ScheduleProperties1_WarningClick(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles ScheduleProperties1.WarningClick

        Call MsgBox("You clicked on the warning! You may put a custom message here is you wish!", MsgBoxStyle.Information)

    End Sub
End Class